﻿@model VendorModel
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";
    Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
    Html.AddMetaDescriptionParts(Model.MetaDescription);
    Html.AddMetaKeywordParts(Model.MetaKeywords);

    var canonicalUrlsEnabled = EngineContext.Current.Resolve<SeoSettings>().CanonicalUrlsEnabled;
    if (canonicalUrlsEnabled)
    {
        var vendorUrl = Url.RouteUrl("Vendor", new { SeName = Model.SeName }, this.Request.Url.Scheme);
        Html.AddCanonicalUrlParts(vendorUrl);
    }
}
@using Nop.Core.Domain.Seo;
@using Nop.Core.Infrastructure;
@using Nop.Web.Models.Catalog;
<div class="page vendor-page">
    <div class="page-title">
        <h1>@Model.Name</h1>
    </div>
    <div class="page-body">
        @Html.Widget("vendordetails_top", Model.Id)
        @*description*@
        @if (!String.IsNullOrWhiteSpace(Model.Description))
        {
            <div class="vendor-description">
                @Html.Raw(Model.Description)
            </div>
        }
        @*contact vendor*@
        @if (Model.AllowCustomersToContactVendors)
        {
            <div class="contact-vendor">
                <input type="button" value="@T("ContactVendor")" class="button-2 contact-vendor-button" onclick="setLocation('@Url.RouteUrl("ContactVendor", new { vendorId = Model.Id })')" />
            </div>
        }
        @if (Model.Products.Count > 0)
        {
            @Html.Partial("_CatalogSelectors", Model.PagingFilteringContext, new ViewDataDictionary())
        }
        @*product list*@
        @if (Model.Products.Count > 0)
        {
            <div class="@(Model.PagingFilteringContext.ViewMode == "list" ? "product-list" : "product-grid")">
                <div class="item-grid">
                    @foreach (var product in Model.Products)
                    {
                        <div class="item-box">
                            @Html.Partial("_ProductBox", product)
                        </div>
                    }
                </div>
            </div>
        }
        @{
            var pager = Html.Pager(Model.PagingFilteringContext).QueryParam("pagenumber");
        }
        @if (!pager.IsEmpty())
        {
            <div class="pager">
                @pager
            </div>
        }
        @Html.Widget("vendordetails_bottom", Model.Id)
    </div>
</div>
